import routes from './routes'
import VueRouter from 'vue-router'
import Vue from 'vue'
Vue.use(VueRouter)
export default () => {
  return new VueRouter({
    routes,
    mode: 'history',
    linkActiveClass: "active-link",
    linkExactActiveClass: 'exact-active-link',

    scrollBehavior (to, from, savedPosition) {
      if (savedPosition) {
        console.log(savedPosition, 'savedPosition')
        return savedPosition
      } else {
        return {
          x: 0,
          y: 0
        }
      }
    },
    fallback: true
  })
}
